package com.imooc.mall.exception;

import lombok.Data;

/**
 * @author zwj
 * @Description: 统一异常处理
 * @date 2022/10/17 2:10 下午
 */
@Data
public class ImoocMallException extends RuntimeException{
    private final Integer code;
    private final String message;

    public ImoocMallException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ImoocMallException(ImoocMallExceptionEnum exceptionEnum) {
        this(exceptionEnum.getCode(), exceptionEnum.getMsg());
    }
}
